import { BaseApi } from '/@/api-services/apis/baseApi';
import { SysConfig, ConfigUpdateInput, ConfigAddInput,ConfigOutInput } from '../../models/system'

/**
 * 字典数据Api
 */
class SysConfigApi extends BaseApi<SysConfig, ConfigAddInput, ConfigUpdateInput> {

    //获取配置列表
    getConfigList=async(data:object)=>{
      return this.normalGet<Array<SysConfig>>(`/getConfigList`,data)
    }
    //获取配置明细
    getConfigInfo=async(data:object)=>{
        return this.normalGet<Array<SysConfig>>(`/getConfigList`,data)
    }
    //获取系统配置
    getSystemConfig=async()=>{
        return this.normalGet<ConfigOutInput>(`/getSystemConfig`,null)
    }
    //更新系统配置
    updateSystemConfig=async(data:ConfigOutInput)=>{
        return this.normalPost<ConfigOutInput>(`/updateSystemConfig`,data)
    }
}

export default new SysConfigApi('/system/config');